package pizza4;

import java.util.Scanner;

/**
 * @Auther: xiaofei
 * @Date: 2021/7/1 - 07 - 01 - 8:51
 * @Description: pizza4
 * @version: 1.0
 */
public class PizzaStore {
    public static Pizza getPizza(int choice){
        Scanner sc = new Scanner(System.in);
        Pizza p = null;
        switch(choice){
            case 1:
            {
                System.out.println("请输入要添加的培根克数：");
                double weight = sc.nextDouble();
                System.out.println("请输入要披萨的大小：");
                int size = sc.nextInt();
                System.out.println("请输入披萨的价格：");
                double price = sc.nextDouble();

                //封装信息
                BurdenPizza bp = new BurdenPizza("培根披萨",size,price,weight);
                p = bp;
            }break;
            case 2:
            {
                System.out.println("请输入要添加的水果：");
                String burdening = sc.next();
                System.out.println("请输入披萨的大小：");
                int size = sc.nextInt();
                System.out.println("请输入披萨的价格：");
                double price = sc.nextDouble();

                //封装信息
                FruitsPizza fp = new FruitsPizza("水果披萨", size, price, burdening);
                p = fp;
            }break;
        }
        return p;
    }
}
